home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Sample Code / AOCE Sample Code / PowerTalk Access Modules / Sample SMSAM / SampleSMSAM Source / BuildingBlocks / DirectObject.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-28  |  1.5 KB  |  66 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        DirectObject.h
  3.  
  4.     Copyright:    © 1991-1994 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Part of the AOCE Sample SMSAM Package.  Consult the license
  8.     which came with this software for your specific legal rights.
  9.  
  10. */
  11.  
  12.  
  13.  
  14. #ifndef    __DIRECTOBJECT__
  15. #define    __DIRECTOBJECT__
  16.  
  17. #ifndef    __TYPES__
  18. #include "Types.h"
  19. #endif
  20.  
  21. #pragma push
  22. #pragma segment DirectObject
  23.  
  24. class ostream;
  25.  
  26. /***********************************|****************************************/
  27.  
  28. class TDirectObject
  29. {
  30. public:        TDirectObject ();
  31.     virtual    ~TDirectObject ();
  32.     
  33.     virtual    ostream&                operator >> ( ostream& ) const;
  34.  
  35. #if defined ( debug )
  36.     Boolean                         TDirectObject::IsValidObject ( Boolean mustReturn = false ) const;
  37.     static Boolean                    IsADirectObject ( const void * p );
  38. #endif
  39.  
  40. public:        void*                    operator new ( unsigned int );
  41.             void                    operator delete ( void* );
  42.     
  43. protected:    TDirectObject ( const TDirectObject& );
  44.             TDirectObject&            operator = ( const TDirectObject& );
  45.  
  46. #if defined ( debug )
  47. private:    OSType                    fTag;
  48. #endif
  49. };
  50.  
  51. /***********************************|****************************************/
  52.  
  53. #if defined ( THINK_CPLUS ) || defined ( __SC__ )
  54.     typedef TDirectObject SingleObject;
  55. #endif
  56.  
  57. const OSType kDirectObjectTag = 'DTAG';
  58. extern ostream& operator << ( ostream& s, const TDirectObject* o );
  59. inline ostream& operator << ( ostream& s, const TDirectObject& o ) { return o >> s; };
  60.  
  61. /***********************************|****************************************/
  62.  
  63. #pragma pop
  64.  
  65. #endif    // __DIRECTOBJECT__
  66.